<ui:composition template="/templates/layout.xhtml" xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:c="http://java.sun.com/jstl/core"
     xmlns:fmt="http://java.sun.com/jstl/fmt"
     xmlns:x="http://java.sun.com/jstl/xml"
     xmlns:fn="http://java.sun.com/jstl/functions"
     xmlns:a4j="http://richfaces.org/a4j"
     xmlns:rich="http://richfaces.org/rich"
     xmlns:gape="http://componentes.gape/component/gape">
     
	<ui:define name="titulo">
		<h:outputText value="#{msg.applicationName} - #{msg.tituloDefineValues}" />
	</ui:define>

	<ui:define name="menu">
		<ui:include src="/menu/menuStrategicPlan.xhtml" />
	</ui:define>
	
	<ui:define name="conteudo">
		<h:panelGrid columns="2" headerClass="pathway">
			<f:facet name="header">
				<h:outputText value="#{msg.tituloDefineValues}" styleClass="pathway"/>
			</f:facet>
						
			<rich:scrollableDataTable height="200px" width="600px" id="values" rowClasses="odd,even" value="#{organization.listValues}" var="row" rowKeyVar="linha" selectionMode="multi" 
									  selection="#{organization.selection}"> 
				<f:facet name="header">
					<h:outputText value="#{msg.organizationTitleValuesGrid}" styleClass="pathway"/>
				</f:facet>
				
				<rich:column width="40px">
					<f:facet name="header">
						<h:outputText value="#{msg.positionTitleColumn}" />
					</f:facet>
					
					<h:outputText value="#{row.position}" />
				</rich:column>
									  										  
				<rich:column width="500px">
					<f:facet name="header">
						<h:outputText value="#{msg.valuesTitleColumn}" />
					</f:facet>				
				
					<h:outputText value="#{row.value}"/>
				</rich:column>
				
				<rich:column width="40px">
					<f:facet name="header">
						<h:outputText value="#{msg.actionsTitleColumn}" />
					</f:facet>				
				
	            	<h:commandLink id="delete" action="#{organization.deleteValue}" styleClass="imageLink">
                    	<h:graphicImage value="/files/delete.png" style="border:0" />
                        <f:setPropertyActionListener value="#{linha}" target="#{organization.valorSelecionado}" />
                    </h:commandLink>
                    <rich:toolTip for="delete" value="#{msg.buttonDelete}" />		                    
            	</rich:column>
			</rich:scrollableDataTable>
			
			<h:panelGrid columns="1">
				<h:commandButton action="#{organization.upValue}"  image="/files/arrow-up.png"/>
				<h:commandButton action="#{organization.downValue}" image="/files/arrow-down.png"/>
			</h:panelGrid>
		</h:panelGrid>
		
		<h:panelGrid columns="1">						
			<rich:messages layout="list" style="color: Red; align: Center; font-size: 15px"/>						
		</h:panelGrid>
	</ui:define>	
	
	<ui:define name="menuTela">
		<ui:include src="menu.xhtml" />
	</ui:define>	

	<ui:define name="menuNavegacaoBack">
		<gape:navigationBack mbean="#{'menu'}" metodo="#{'redirecionaTela'}" parameterValue="defineMission" parameterTarget="#{menu.menuCode}" />
	</ui:define>
	
	<ui:define name="menuNavegacaoForward">
		<gape:navigationForward mbean="#{'menu'}" metodo="#{'redirecionaTela'}" parameterValue="establishVision" parameterTarget="#{menu.menuCode}" />
	</ui:define>	

	<ui:define name="includePanels">
		<ui:include src="/cadastro-empresa/panelNewValue.xhtml" />
	</ui:define>
</ui:composition>